﻿using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Microsoft.Practices.Unity;
using ScrumTable.BL.DM.DataManagement;
using ScrumTable.Common.Collections;
using ScrumTable.UI.ViewModel;
using ScrumTable.UI.ViewModel.Tools.Toast;

namespace ScrumTable.UI.View.WinTouch.UserControls.Tool.Toast
{

    /// <summary>
    /// Interaction logic for SearchScreen.xaml
    /// </summary>
    public partial class ToastPublisherControl
    {



        #region Decleration
        //--------------------------------------------------------------------
        // Decleration
        //--------------------------------------------------------------------
        public Dictionary<string, NamedValue> SelectedValues { get; set; }

        #endregion

        #region Properties

        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------
        
        [Dependency]
        public ViewModelToastScreen Model
        {
            set { DataContext = value; }
            get { return (ViewModelToastScreen) DataContext; }

        }

        /// <summary>
        /// If true, the controls allows to select a value
        /// </summary>
        public bool IsSelectMode { get; set; }

        #endregion

        #region Constructors / Destructor

        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        public ToastPublisherControl()
        {
            InitializeComponent();
        }


        #endregion

        #region Methods

        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------



        #endregion

        #region Events

        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------

        #endregion
    }



    public class ToastItemTemplateSelector : DataTemplateSelector
    {
        public DataTemplate ErrorTemplate { get; set; }
    

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            var toast = item as ToastItem;
            if (toast != null)
            {
                switch(toast.Type)
                {
                    case ToastType.Error:
                        return ErrorTemplate;
                   
                }
            }
            return null;
        }
    }
}